<h1>Listing stocks</h1>

<p id="notice"><%= notice %></p>

<table class="table table-bordered">
  <tr>   
    <th>Product</th>
    <th>Size</th>
    <th>Quantity</th>
    <th></th>
  </tr>

<% @stocks.each do |stock| %>
  <tr>
   
    <td><%= stock.product.item_number %></td>
    <td><%= stock.size.name %></td>
    <td><%= stock.quantity %></td>
    <td><%= link_to 'Show', stock %>
    <%= link_to 'Edit', edit_stock_path(stock) %>
    <%= link_to 'Destroy', stock, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Stock', new_stock_path ,  :class => "btn btn-default"%>
